﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Ezio.Models.Bodegas>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Administrar Bodegas
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Administraci&oacute;n de Bodegas</h2>
    <form action="Bodegas/Agregar" method="post">
        <fieldset>
            <legend>Agregar nueva Bodega</legend>
            <label>Nombre: </label>
            <input type="text" name="NombreBodega" />
            <input type="submit" value="Agregar" />
        </fieldset>
    </form>
    
    <table>
        <tr>
            <th>
                Nombre
            </th>
            <th></th>
        </tr>

    <%  foreach (var item in (List<Ezio.Models.Bodegas>)ViewData["Bodegas"]) { %>
    
        <tr>
            <td>
                <%: item.NombreBodega %>
            </td>
            <td>
                <%: Html.ActionLink("Edit", "Edit", new { id=item.IdBodega }) %> |
                <%: Html.ActionLink("Eliminar", "Eliminar", new { Id=item.IdBodega })%> |
                <%: Html.ActionLink("Consultar Stock", "StockEnBodega", new { IdBodega = item.IdBodega })%>  
            </td>
            
        </tr>
    
    <% } %>

    </table>
</asp:Content>

